package com.mentaleye.service.impl;

import com.mentaleye.bean.ReturnVisitBean;
import com.mentaleye.dal.dao.ReturnVisitDao;
import com.mentaleye.dal.model.ReturnVisit;
import com.mentaleye.service.ReturnVisitService;
import com.mentaleye.util.ObjectUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by Rock on 2017/5/23.
 */
@Service
public class ReturnVisitServiceImpl implements ReturnVisitService{

    @Autowired private ReturnVisitDao returnVisitDao;

    public boolean add(ReturnVisitBean bean){
        ReturnVisit modle = (ReturnVisit) ObjectUtil.transfer(bean, ReturnVisit.class);
        boolean success = returnVisitDao.insert(modle);
        if(success){
            bean.setReturnVisitId(modle.getReturnVisitId());
        }
        return success;
    }
}
